package NetCrossServer.server;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.SocketException;

public class UdpServer {
    private static Logger logger = LoggerFactory.getLogger(UdpServer.class);
    private String url;
    private int port;

    public UdpServer(String url, int port) {
        this.url = url;
        this.port = port;
    }

    public void start() {
        logger.info("start udp server!");
        byte[] buf = new byte[1024];
        DatagramPacket datagramPacket = new DatagramPacket(buf, buf.length);
        DatagramSocket datagramSocket;
        try {
            datagramSocket = new DatagramSocket(port);
        } catch (SocketException e) {
            e.printStackTrace();
        }

    }


}
